#ifndef USERPROG_SYSCALL_H
#define USERPROG_SYSCALL_H
#include "threads/thread.h"

void syscall_init (void);

void sys_halt(void) NO_RETURN;
void sys_exit(int code) NO_RETURN;

int sys_write (int fd, const void *buf, unsigned len);
int sys_read  (int fd, void *buf, unsigned len);
void sys_seek  (int fd, int pos);
int sys_tell  (int fd);
int sys_filesize(int fd);

int sys_create(const char *file_name, int size);
int sys_open  (const char *file_name);
int sys_remove(const char *file_name);

void sys_close(struct thread *cur, int fd);

int sane_file_name(const char *file_name);
int is_fd_ok(struct thread *cur, int fd);

#endif /* userprog/syscall.h */
